Coverage Measurement
In TASMO you specify the characteristics of signals and determine the coverage goals. TASMO is able to analyze already existing test cases to find out to what extent those test cases test the determined coverage goals with the specified characteristics. TASMO can also use already existing test run data for the test data to be created. In order to do so, TASMO needs to add probes to either the test frame (Simulink model) or to the test driver (C code); this is also called instrumentation.
For Simulink models, the instrumentation is done automatically when you create a new test frame or when you decide to instrument an existing test frame.
When using TASMO with C code, you need to select either Full instrumentation or Coverage measurement as instrumentation level of the test driver With Full instrumentation you can generate new test data and show the coverage measurement in the report. With the level Coverage measurement, only the coverage measurement will be part of the report, but you cannot generate new test data.
MATLAB/Simulink: instrument the test frame
You can instrument a new test frame or an existing test frame. To instrument a new test frame follow these steps:
- Go to the C/C++ platform or MATLAB/Simulink platform configuration and select the TASMO coverage Analysis section.
- Select the Enable measurement during test execution check box.
- Select the coverage criteria(s) (condition coverage, decision coverage).
- Click Generate test frame.
If a test frame already exists, for example when you have manually created it, you can instrument it with TASMO by clicking the little arrow next to the Generate test frame button and select Only instrument existing test frame.
When the test frame is generated, you can switch to the Execution Configuration and start the test execution as usual or run the TASMO test case generator.
When you run the tests as usual, TASMO can later use this trial data to speed up the test data generation process by only generating test data for those selected coverage goals not already covered by the trial data (see Import coverage data).
C code: instrument the test driver
The C code test driver is generated in the C/C++ platform configuration in the section Test driver generation.
- Select either Coverage measurement or Full instrumentation from the TASMO instrumentation list.
- Make all other specifications necessary (see C Platform), then click Generate and Compile test driver.
Increase coverage
TASMO can increase the coverage in two ways:
- by performing a static analysis (only for Simulink/TargetLink models)
- by generating new test data
With the static analysis of the Simulink or TargetLink model, TASMO finds those coverage goals which cannot be reached at all. These coverage goals will be shown with a red "probably unreachable" status before running the test generation. Nevertheless, this status can change to "covered" afterwards. For the MATLAB/Simulink platform, you can disable this feature by deselecting the Check reachability at test data generation check box in the MATLAB/Simulink platform configuration (Generate Test Frame | TASMO Coverage Analysis | Increase model coverage).
The test data generation is started by clicking the TASMO test generator button in